package com.zhiyou.driving.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zhiyou.driving.mapper.CoachMapper;
import com.zhiyou.driving.model.CoachModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * Created by zhouyanchao on 2017/9/4.
 * Descr:
 */
@Service
public class CoachServiceImpl implements ICoachService {


	@Autowired
	CoachMapper mapper;


	@Override
	public List<CoachModel> queryAllCoaches() {

		int pageNum = 1;
		int pageSize = 2;

//		PageHelper.startPage(pageNum,pageSize);

		PageHelper.offsetPage(1,3);

		List<CoachModel> list = mapper.queryAllCoaches();
		Page<CoachModel> page = (Page)list;
		System.out.println(page.getResult());

//		System.out.println(list);

		return null;
	}
}
